//SPDX-FileCopyrightText: Copyright 2022-2024 深圳市同心圆网络有限公司
//SPDX-License-Identifier: GPL-3.0-only

package chat_dao

import "go.mongodb.org/mongo-driver/mongo"

var GroupDao *_GroupDao
var GroupMemberDao *_GroupMemberDao
var GroupMsgIndexDao *_GroupMsgIndexDao

func InitDao(mgoDb *mongo.Database) (err error) {
	GroupDao, err = newGroupDao(mgoDb)
	if err != nil {
		return
	}
	GroupMemberDao, err = newGroupMemberDao(mgoDb)
	if err != nil {
		return
	}
	GroupMsgIndexDao, err = newGroupMsgIndexDao(mgoDb)
	if err != nil {
		return
	}
	return
}
